<template>
	<view class="wrapper" :style="{'background-image': backgrou}">

		<view class="status-bar" style="z-index: 1000;" :style="{'color': color,}">
		</view>
		<view class="nav" :style="{'color': color,'border-bottom':border}">
			<image class="back" @click="back" v-if="backshow==false" style="width: 44px;height: 44px;"
				src="/static/image/components/fanhui.png"></image>
			<text class="title_sss" :style="{'color': color}">{{title}}</text>

			<!-- 服务左边切换大学 -->
			<view class="cut" v-if="dizhi" @click="dianjishoucang">
				<image class="dizhi" src="/static/image/index/dizhi.png"></image>
				<view class="dizhi_name" @click="huoqudizhi(dizhi)">
					{{dizhi}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background:'rgba(0, 0, 0, 0)'
			}
		},
		props: {
			title: {
				type: String,
				default: ""
			},
			show: {
				type: Boolean,
				default: false
			},
			fanhuis: {
				type: String,
				default: ""
			},
			backshow: {
				type: Boolean,
				default: false
			},
			color: {
				type: String,
				default: "#333333"
			},
			border: {
				type: String,
				default: "2rpx solid rgba(0,0,0,0)"
			},
			dizhi: {
				type: String,
				default: ""
			},
			backgrou:{
				type: String,
				default: "url(/static/image/components/header.png)"
			}
		},
		// beforeCreate() {
		// 	const domModule = weex.requireModule('dom')
		// 	domModule.addRule('fontFace', {
		// 		fontFamily: "unibtn",
		// 		'src': "url('../../../../static/uni.ttf')"
		// 	});
		// },
		methods: {
			huoqudizhi(name){
				if(name=='请先授权'){
					this.$emit('huoqudizhi', false);
				}
			},
			back() {
				var tt = this;
				if (this.fanhuis == '') {
					uni.navigateBack();
				} else {
					uni.navigateBack({
						delta: 2
					});
				}

			},
		},
	}
</script>

<style lang="scss">
	.cut {
		float: right;
		position: absolute;
		left: 30rpx;
		top: 0;
		display: flex;
		align-items: baseline;
		line-height: 88rpx;
		height: 88rpx;
		.dizhi{
			width: 42rpx;
			margin-right: 10rpx;
			height:42rpx;
		}
		.dizhi_name {
			font-size:24rpx;
			color:#333333;
			font-weight: bold;
		}
	}
	// 修改css
	.wrapper {
		flex: 1;
		background-color: #FFFFFF;
		flex-direction: column;
		width: 100%;
		position: fixed;
		top: 0px;
		z-index: 13;
		left: 0px;
		// height: calc(var(--status-bar-height) + 88rpx);
		height: calc(var(--status-bar-height) + 140rpx);
		background-size: 100% 100%;
	}

	.status-bar {
		flex: 1;
		width: 100%;
		height: var(--status-bar-height);
	}
	// 修改css
	.nav {
		position: relative;
		height: 140rpx;
		flex: 0;
		justify-content: center;
		align-items: center;
		text-align: center;
		z-index:13
	}
	// 修改css
	.title_sss {
		display:inline-block;
		width: 80%;
		text-align: center;
		font-size: 34rpx;
		// line-height: 44px;
		line-height: 70px;
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
		/* font-weight: bold; */
	}

	.title_sss span {
		display: block;
		margin: auto;
		width: 70%;
		text-align: center;
		font-size: 36rpx;
		font-weight: bold;
		color: #333333;
		// line-height: 44px;
		line-height: 70px;
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
	}
	// 修改css
	.back {
		position: absolute;
		left: 8px;
		top: 29rpx;//本来没有top
		color: #FFFFFF;
		font-family: unibtn;
	}
</style>
